<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let obj = {
        name: "zks",
        age: 18,
        get uuname() {
          return this.name.substring(0, 1) + this.name.substring(1);
        },
        set uuname(value) {
          this.name = value;
        },
      };
      obj.name = "asd";
      console.log(obj.name);

      //   介使用方法 用于浅拷贝

      const obj1 = {};
      //   Object.assign(obj1, obj); //不会拷贝get set方法
      //   obj1.name = 555;
      //   console.log(obj.name,'拷贝');//asd 拷贝

      Object.assign(obj1, Object.getOwnPropertyDescriptors(obj));//拷贝get set方法
      console.log(obj1); 

      const object1 = {
  a: 'somestring',
  b: 42,
};

console.log(Object.entries(object1));

// Expected output:
// "a: somestring"
// "b: 42"

    </script>
  </body>
</html>
